package day08_stream_file_charset.com.itheima.d2_file;

import java.io.File;
import java.text.SimpleDateFormat;

public class FileDemo2 {
    public static void main(String[] args) {
        File f1 = new File("D:/dlei.jpg");
        System.out.println("f1.exists() = " + f1.exists());
        System.out.println("f1.isDirectory() = " + f1.isDirectory());
        System.out.println("f1.isFile() = " + f1.isFile());
        System.out.println("f1.getName() = " + f1.getName());
        System.out.println("f1.length() = " + f1.length());

        long time = f1.lastModified();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("f1.lastModified() = " + sdf.format(time));
        System.out.println("f1.getAbsolutePath() = " + f1.getAbsolutePath());
        System.out.println("f1.getPath() = " + f1.getPath());
    }
}
